package com.iris.thread.isAlive;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


public class IsAliveTest {

	public static void main(String[] args) {
		List<ThreadIsAliveTestBefore> list=new ArrayList<ThreadIsAliveTestBefore>();
		Random random=new Random();
		int count = random.nextInt(30);
		ExecutorService pool=Executors.newFixedThreadPool(5);
		Thread after=new Thread(new ThreadIsAliveTestAfter(list));
		after.start();
		for (int i = 0; i < count; i++) {
			ThreadIsAliveTestBefore tbefore=new ThreadIsAliveTestBefore(UUID.randomUUID().toString());
			list.add(tbefore);
			pool.execute(tbefore);
		}
	}
}
